
@page  "/Students"
@model StudentManagement.RazorPage.Pages.Students.IndexModel
@{
    ViewData["Title"] = "Index";
}

<style>
    .btn {
        width: 75px;
    }
</style>

<h1>学生</h1>

<div class="card-deck">
    @foreach (var student in Model.Students)
    {
        var photoPath = "~/images/" + (student.PhotoPath ?? "noimage.png");
        <div class="card m-3" style="min-width: 18rem; max-width:30.5%;">
            <div class="card-header">
                <h3>@student.Name</h3>
            </div>

            <img class="card-img-top imageThumbnail" src="@photoPath"
                 asp-append-version="true" />

            <div class="card-footer text-center">
                <a asp-page="/Students/Details" asp-route-ID="@student.Id" class="btn btn-primary m-1">详情</a>
                <a  asp-page="/Students/Edit"  asp-route-ID="@student.Id" class="btn btn-primary m-1">编辑</a>
                <a href="#" class="btn btn-danger m-1">删除</a>
            </div>
        </div>
    }
</div>